package _02011

func removeElement(nums []int, val int) int {

	k := 0

	for i, num := range nums {
		if num != val {
			nums[k], nums[i] = nums[i], nums[k]
			k += 1
		}
	}

	return k
}
